<template>
	<div class="bg-[#EFEFEF]">
		<div class="container mx-auto space-y-5 py-5">
			<div class="max-md:px-3">{{ lg === 0 ? "Home > About Us" : lg === 1 ? "首页 > 关于我们" : "首頁 > 關於我們" }}</div>
			<div class="bg-white p-14 max-md:p-3 text-gray-400 gap-5 flex flex-col justify-center items-center">
				<!-- <div v-html="content" class="gap-5 flex flex-col"></div> -->
				<div
					v-html="content"
					class="w-full md:max-w-3xl flex flex-col md:gap-3 min-h-[40vh]"
					style="overflow-wrap: break-word; word-wrap: break-word"
				></div>
			</div>
		</div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			content: {}
		};
	},

	created() {
		this.config();
	},

	methods: {
		async config() {
			// 使用this.$to函数发起请求，获取数据
			const [err, res] = await this.$to(this.$axios.get(`&a=getAbout&typeid=${this.$route.query.typeid}`));
			// 如果发生错误，则返回错误信息
			if (err) return this.$message.error(err);
			// 如果返回的code不为0，则返回错误信息
			if (res.code == 0) return this.$message.error(res.msg);

			// 将返回的数据中的text-wrap: nowrap;替换为空
			this.content = res.data.row.content.replace(/text-wrap:\s*nowrap;/g, "");
		}
	}
};
</script>

<style lang="scss" scoped></style>
